package org.jeecg.modules.lab.syn;

import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;

/**
 * 数据库连接;保持数据库一直连接
 */
public class DatabaseConnectionManager {
    private static HikariDataSource dataSource;


    static {
        //同步数据数据库设置
        HikariConfig config = new HikariConfig();
        config.setJdbcUrl("jdbc:mysql://127.0.0.1:3306/lab?characterEncoding=utf-8&allowMultiQueries=true");
        config.setUsername("root");
        config.setPassword("1qaz2WSX3edc@#");
//        config.setPassword("123456");
        dataSource = new HikariDataSource(config);

    }
    public static HikariDataSource getDataSource() {
        return dataSource;
    }


}
